package com.wy.two.Builder;

/**
 * @author 33117
 * @version 1.0
 * @data 2025/3/10 16:14
 * 最后，我们创建指导者类 Director，它协调建造过程并返回构建的房屋对象。
 */
public class Director {
    private HouseBuilder builder;

    public Director(HouseBuilder builder) {
        this.builder = builder;
    }

    public House constructHouse() {
        builder.buildFoundation();
        builder.buildStructure();
        builder.buildRoof();
        builder.buildInterior();
        return builder.getHouse();
    }
}
